USE DB_TCC
IF EXISTS(SELECT 1 FROM SYSOBJECTS WHERE NAME LIKE 'P_AREA_LISTAR')
	DROP PROCEDURE P_AREA_LISTAR
GO
CREATE PROCEDURE P_AREA_LISTAR(
	@IDAREA INTEGER)
AS BEGIN
	SELECT
		IDAREA,
		DESCAREA,
		USUARIOINCLUSAO,
		DTHRINCLUSAO,
		USUARIOALTERACAO,
		DTHRALTERACAO
	FROM
		AREA
	WHERE
		(IDAREA = @IDAREA OR @IDAREA = 0)
END